//
//  SDPaientInfoLTView.m
//  SKinDiary
//
//  Created by pcyang on 16/7/24.
//  Copyright © 2016年 tencent. All rights reserved.
//

#import "SDPaientInfoLTView.h"

@implementation SDPaientInfoLTView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = [UIColor clearColor];
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, 50, self.height)];
        _nameLabel.textColor = [UIColor colorWithRGB:0xbcbec8];
        [_nameLabel setFont:[UIFont systemFontOfSize:13.f]];
        [self addSubview:_nameLabel];
        
        _valueLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.width - _nameLabel.right, self.height)];
        _valueLabel.textColor = [UIColor colorWithRGB:0x747f8b];
        [_valueLabel setFont:[UIFont systemFontOfSize:13.f]];
        [self addSubview:_valueLabel];
    }
    return self;
}

-(void)setName:(NSString *)name
{
    self.nameLabel.text = name;
    [self.nameLabel sizeToFit];
    self.nameLabel.left = 0;
    self.nameLabel.width = 30;
    self.nameLabel.textAlignment = NSTextAlignmentRight;
    self.nameLabel.top = (self.height - self.nameLabel.height)/2;
    
    self.valueLabel.left = self.nameLabel.right + 15;
}
@end
